package com.lancoo.ccas52.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lancoo.ccas52.config.MybatisRedisCache;
import com.lancoo.ccas52.entity.Major;
import com.lancoo.ccas52.pojo.vo.CollegeDto;
import com.lancoo.ccas52.pojo.vo.GradeDto;
import com.lancoo.ccas52.pojo.vo.MajorDto;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author quin.song
 * @since 2023-03-23
 */
@CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class)
public interface MajorMapper extends BaseMapper<Major> {

    int addBatch(@Param("majorCollection") Collection<Major> majorCollection);


    /**
     * 专业表获取学院去重信息
     * @param taskId
     * @return
     */
    List<CollegeDto> getCollegeByTaskId(@Param("taskId") Integer taskId);

    /**
     * 确定选课获取院系
     * @param taskId
     * @param collegeId
     * @param keyWord
     * @param arrangeSubmit 0未提交 1已提交
     * @return
     */
    List<CollegeDto> getCollegeStatus(@Param("taskId") Integer taskId,@Param("collegeId") String collegeId, @Param("keyWord") String keyWord, @Param("arrangeSubmit") Integer arrangeSubmit);

    List<MajorDto> getMajor(@Param("taskId") Integer taskId, @Param("collegeId") String collegeId);

    List<GradeDto> getGrade(@Param("taskId") Integer taskId, @Param("collegeId") String collegeId, @Param("majorId") String majorId);


    /**
     * 获取专业选课上限
     * @param gradeId 基础平台年级id
     * @param majorId 基础平台专业id
     * @param studyNature
     * @return
     */
    @Deprecated
    Major getMajorLimit(@Param("gradeId") String gradeId,@Param("majorId") String majorId,@Param("studyNature") Integer studyNature);

}
